/**
 * Copyright � 2012 GestureSoft. ALL RIGHTS RESERVED.
 * This file contains proprietary and GestureSoft CONFIDENTIAL Information.
 * Use, disclosure or reproduction is prohibited.
 * 
 * @fileName AppModel.as
 * @creationDate Aug 8, 2012
 * @author 
 * @version 1.0
 */
package com.gesturesoft.imultimax.model
{
	
	import mx.collections.ArrayCollection;
	
	import pl.mllr.extensions.contactEditor.ContactEditor;
	import pl.randori.air.nativeextensions.ios.MailExtension;
	
	public class AppModel
	{
		
		private static var _appModel:AppModel;
		
		private var _companies:ArrayCollection;
		private var _currentCompanyIndex:int = 0;
		private var _assets:ArrayCollection;
		private var _assetObj:Object;
		private var _currency:String;
		private var _extension:MailExtension;
		private var _contactExtension:ContactEditor;
		private var _userInvokeData:String;
		private var _targetPlatform:String;
		private var _userRequestContact:Boolean;
		private var _offlineMode:Boolean;
		private var _logoutVisible:Boolean;
		private var _is24HourFormat:Boolean;
		private var _backgroundImageUrl:String;
		private var _confirmPinFail:Boolean;
		private var _cardType:String;
		
		public function AppModel()
		{
			
		}
		
		public static function getInstance():AppModel
		{
			
			_appModel = (_appModel == null)?new AppModel:_appModel;
			return _appModel;
			
		}
		
		
		/**
		 * Return the target platform 
		 */ 
		public function get targetPlatform():String
		{
			
			return _targetPlatform;
		}
		public function set targetPlatform(val:String):void
		{
			
			this._targetPlatform = val;
			
		}
		
		public function get userRequestContact():Boolean
		{
			
			return _userRequestContact;
			
		}
		
		public function set userRequestContact(val:Boolean):void
		{
			
			this._userRequestContact = val;
			
		}
		
		[Bindable]
		public function get logoutVisible():Boolean
		{
			
			return _logoutVisible;
			
		}
		
		public function set logoutVisible(val:Boolean):void
		{
			
			this._logoutVisible = val;
			
		}
		
		public function get currentCompanyIndex():int
		{
			
			return _currentCompanyIndex;
			
		}
		
		public function set currentCompanyIndex(val:int):void
		{
			
			this._currentCompanyIndex = val;
			
		}
		
		[Bindable]
		public function get companies():ArrayCollection
		{
			
			return _companies;
			
		}
		
		public function set companies(val:ArrayCollection):void
		{
			
			this._companies = val;
			
		}
		
		[Bindable]
		public function get offlineMode():Boolean
		{
			
			return _offlineMode;
			
		}
		
		public function set offlineMode(value:Boolean):void
		{
			
			this._offlineMode = value;
			
		}
		
		/**
		 * Return assets array collection contian images
		 */ 
		[Bindable]
		public function get assets():ArrayCollection
		{
			
			return _assets;
			
		}
		
		public function set assets(val:ArrayCollection):void
		{
			
			this._assets = val;
			
		}
		
		/**
		 * Return assets object contian assets unformation images
		 */ 
		[Bindable]
		public function get assetObj():Object
		{
			
			return _assetObj;
			
		}
		
		public function set assetObj(val:Object):void
		{
			
			this._assetObj = val;
			
		}
		
		/**
		 * Return _currency Currency used by the company
		 */ 
		
		[Bindable]
		public function get currency():String
		{
			
			return _currency;
			
		}
		
		public function set currency(val:String):void
		{
			
			this._currency = val;
			
		}
		
		/**
		 * Return extension used by the app
		 */ 
		[Bindable]
		public function get extension():MailExtension
		{
			
			return _extension;
			
		}
		
		public function set extension(val:MailExtension):void
		{
			
			this._extension = val;
			
		}
		
		
		/**
		 * Return extension used by the app
		 */ 
		
		[Bindable]
		public function get contactExtension():ContactEditor
		{
			
			return _contactExtension;
			
		}
		
		public function set contactExtension(val:ContactEditor):void
		{
			
			this._contactExtension = val;
			
		}
		
		/**
		 * Return extension used by the app
		 */ 
		
		[Bindable]
		public function get userInvokeData():String
		{
			
			return _userInvokeData;
			
		}
		
		public function set userInvokeData(val:String):void
		{
			
			this._userInvokeData = val;
			
		}
		
		[Bindable]
		public function get isDevice24HourFormat():Boolean
		{
			
			return _is24HourFormat;
			
		}
		
		public function set isDevice24HourFormat(val:Boolean):void
		{
			
			this._is24HourFormat = val;
			
		}
		
		/**
		 * Return the target platform 
		 */ 
		[Bindable]
		public function get backgroundImageUrl():String
		{
			
			return _backgroundImageUrl;
		}
		public function set backgroundImageUrl(val:String):void
		{
			
			this._backgroundImageUrl = val;
			
		}
		
		[Bindable]
		public function get confirmPinFail():Boolean
		{
			
			return this._confirmPinFail;
			
		}
		public function set confirmPinFail(value:Boolean):void
		{
			
			this._confirmPinFail = value;
			
		}
		
		[Bindable]
		public function get cardType():String { return _cardType; }
		
		public function set cardType(value:String):void
		{
			if (_cardType == value)
				return;
			_cardType = value;
		}
		
	}
	
}